import multiprocessing      #多进程
import time, threading

#启动10个进程，每个进程启动一个线程


def thread_run():
    print(threading.get_ident())

def run(name):
    time.sleep(2)
    print('hello', name)
    t = threading.Thread(target=thread_run)
    t.start()

if __name__ == '__main__':
    for i in range(10):
        p = multiprocessing.Process(target=run, args=('bob is %s' % i,))
        p.start()